package com.umeox.watch.moto.dataservice.mqtt.request;


import com.alibaba.fastjson.JSONObject;
import com.umeox.moto.mqtt.request.MqttPublishRequest;
import com.umeox.watch.moto.dataservice.base.BaseApp;

/**
 * 属性请求封装
 */
public class AttributeRequest extends MqttPublishRequest {

    public AttributeRequest(String topic, Object params) {
        JSONObject temp = new JSONObject();
        this.requestId = BaseApp.getInstance().createRequestId();
        temp.put("keys", params);
        this.topic = topic + requestId;
        this.qos = 0;
        this.payloadObj = temp.toString();
        this.replyTopic = topic.substring(0,topic.lastIndexOf("/")) + "_reply/" + requestId;
    }
}
